from fake_useragent import UserAgent
import requests
from lxml import etree

url = "https://www.taobao.com/markets/paimai/artworks?spm=a2129.3065125.0.0.bce91c3aH0bsCL"
headers = {
    "User-Agent": UserAgent().random
}
resp = requests.get(url=url, headers=headers)
e = etree.HTML(resp.text)
urls = ["https://img.alicdn.com/tfs/TB1sIvmxYPpK1RjSZFFXXa5PpXa-228-58.jpg",
        "https://img.alicdn.com/tfs/TB1ckbFx4jaK1RjSZFAXXbdLFXa-228-58.jpg",
        "https://img.alicdn.com/tfs/TB1xRGjSAPoK1RjSZKbXXX1IXXa-228-58.jpg",
        "https://img.alicdn.com/tfs/TB1Dfzqx4TpK1RjSZFGXXcHqFXa-228-58.jpg",
        "https://img.alicdn.com/tfs/TB1DU_Cx4YaK1RjSZFnXXa80pXa-228-58.jpg",
        "https://img.alicdn.com/tfs/TB1tHHxx3HqK1RjSZFkXXX.WFXa-228-58.jpg",
        "https://img.alicdn.com/tfs/TB1HE_Cx4YaK1RjSZFnXXa80pXa-228-58.jpg",
        "https://img.alicdn.com/tfs/TB16Xvox9zqK1RjSZFLXXcn2XXa-228-58.jpg",
        "https://gw.alicdn.com/tfs/TB1Mvz0bbr1gK0jSZFDXXb9yVXa-228-58.jpg",
        "https://gw.alicdn.com/tfs/TB1M628blv0gK0jSZKbXXbK2FXa-228-58.jpg",
        "https://gw.alicdn.com/tfs/TB1PVY8blr0gK0jSZFnXXbRRXXa-228-58.jpg",
        "https://gw.alicdn.com/tfs/TB1zgDIdkH0gK0jSZPiXXavapXa-228-58.png",
        "https://gw.alicdn.com/tfs/TB1ZvSBcuL2gK0jSZPhXXahvXXa-228-58.jpg",
        "https://gw.alicdn.com/tfs/TB1Il3abmf2gK0jSZFPXXXsopXa-228-58.jpg",
        "https://gw.alicdn.com/tfs/TB1ClnZbmf2gK0jSZFPXXXsopXa-228-58.jpg",
        "https://gw.alicdn.com/tfs/TB1bfz4bXY7gK0jSZKzXXaikpXa-228-58.jpg",
        "https://gw.alicdn.com/tfs/TB1KED3bhD1gK0jSZFKXXcJrVXa-228-58.jpg",
        "https://gw.alicdn.com/tfs/TB1yPTZbfb2gK0jSZK9XXaEgFXa-228-58.jpg",
        ]
names = e.xpath('//*[@id="guid-289370"]/div/div/div/div/div/ul/li/div[2]/a/text()')
print(len(urls))
print(len(names))
for index, name in enumerate(names):
    print('{url: "' + urls[index] + '", name: "' + name.strip() + '"},')
